package com.btks.jswater.controller;

import com.alibaba.fastjson.JSONObject;
import com.btks.jswater.entity.Value;
import com.btks.jswater.service.impl.CountServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Api(tags = "九师用水情况统计")
@Controller
@RequestMapping("/data")
public class CountController {
    @Autowired
    private CountServiceImpl countService;
    @ApiOperation("九师用水量实际、计划和差值（万方）")
    @GetMapping("/getAll")
    @ResponseBody
    public JSONObject getWaterUse(){
        return countService.getCount();
    }

    @ApiOperation("某个监测站实际流量（万方）")
    @GetMapping("/getValue")
    @ResponseBody
    public List<Value> getWaterValue(){
        return countService.getValue();
    }


}
